﻿Imports System.Windows.Data

Namespace Converter

    Public Class BooleanToVisibilityConverter
        Implements IValueConverter

        Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
            Return If(CBool(value), Visibility.Visible, Visibility.Collapsed)
        End Function

        Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
            Dim v = DirectCast(value, Visibility)
            Return v = Visibility.Visible
        End Function

    End Class

End Namespace
